package com.neusoft.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 商品类
 *
 * @author Lucifer
 * @since 2021/5/15 上午8:37
 */
@Data
@TableName("item")
@ApiModel("商品表-item")
public class Item implements Serializable {

    private static final long serialVersionUID = 3148176768559230877L;

    @TableId(type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("名称")
    private String name;

    @ApiModelProperty("价格")
    private Double price;

    @TableField(exist = false)
    @ApiModelProperty(value = "折后价格：如果有打折，该字段值为打折后的价格", hidden = true)
    private Double sale_price;
    @ApiModelProperty("图片路径")
    private String url;
    @ApiModelProperty("首页图片路径")
    private String banner;
    @ApiModelProperty("商品描述")
    private String description;
    @ApiModelProperty("打折ID:有打折不为空")
    private Integer sale_id;
    @ApiModelProperty("分类ID")
    private Integer category_id;
    @ApiModelProperty("满减ID:有满减不为空")
    private Integer fullless_id;
    @ApiModelProperty(hidden = true)
    private Date create_time;
    @ApiModelProperty(hidden = true)
    private Date update_time;
    @TableField(exist = false)
    @ApiModelProperty(value = "评论集合", hidden = true)
    private List<Comment> comments;
    @TableField(exist = false)
    @ApiModelProperty(value = "满减活动", hidden = true)
    private Fullless fullless;
    @TableField(exist = false)
    @ApiModelProperty(value = "打折活动", hidden = true)
    private Sale sale;
    @TableField(exist = false)
    @ApiModelProperty(value = "商品分类", hidden = true)
    private Category category;
}

